cmake_minimum_required(VERSION 3.16)

# 设置可执行文件名称
set(BIN_NAME dtkwidget-template)

# 查找Qt6库，并指定需要的组件为Core
find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets)
find_package(Dtk6 COMPONENTS Core Gui Widget REQUIRED)

# 设置Qt6标准项目,该命令包含在Qt6的Core组件中
qt_standard_project_setup()

# 包含源文件
set(SRCS
    main.cpp
    mainwindow.cpp
    mainwindow.h
)

# 添加可执行文件
qt_add_executable(${BIN_NAME} 
    ${SRCS}
)

# 指定链接库
target_link_libraries(${BIN_NAME} PRIVATE 
    Qt6::Core
    Qt6::Gui
    Qt6::Widgets
    Dtk6::Core
    Dtk6::Gui
    Dtk6::Widget    
)

# 安装二进制
install(TARGETS ${BIN_NAME} DESTINATION ${CMAKE_INSTALL_BINDIR})
